from myelin.Ns import MYELIN, FOAF, DC, DCTERMS

from myelin.rdf.bindery.ObjectTypes import LiteralTypeO

from Resource import Resource
from Document import Document

#import Agent

from ObjectTypes import \
    GraphTypeO, GraphTypeS, \
    GraphDocumentTypeO, GraphDocumentTypeS, \
    ResourceTypeO

from mappings import \
    GraphMap, \
    GraphTypesMap


class Graph(Resource):
    
    ModelTypes = (GraphTypeO, GraphTypeS)
    
    RDF_BINDINGS = {
        'mPrimary_Type'         : ((MYELIN, 'primary-type'), ResourceTypeO, GraphTypesMap),
        'mHas_Document'         : ((MYELIN, 'for-graph'), GraphDocumentTypeS, GraphMap),
    }
    
    def rdf_getDomain(self):
        self.rdf_domain = self.rdf_scope
        return self.rdf_domain
    

class GraphDocument(Document):
    
    ModelTypes = (GraphDocumentTypeO, GraphDocumentTypeS)
    
    RDF_BINDINGS = {
        'mFor_Graph'            : ((MYELIN, 'for-graph'), GraphTypeO, GraphMap),
    }

    
CLASS_TYPES = {
    MYELIN + 'Graph'            : Graph,
    MYELIN + 'GraphDocument'    : GraphDocument,
}